package com.zjt.web;

import com.zjt.entity.Report;
import com.zjt.service.user.IReportService;
import com.zjt.web.api.vo.base.PageVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * Created with IntelliJ IDEA.
 * User: xueyanbeijing
 * Date: 12-9-14
 * Time: PM2:48
 * To change this template use File | Settings | File Templates.
 */
@Controller
@RequestMapping(value="/web/report")
public class ReportController {
    private IReportService reportService;

    @Autowired
    public void setReportService(IReportService reportService) {
        this.reportService = reportService;
    }

    @RequestMapping(value="/reportlist",method = RequestMethod.GET)
    public String userlist(PageVO pageVO,Model model)
    {
        Page<Report> list = this.reportService.getReportList(pageVO);
        model.addAttribute("list",list.getContent());
        pageVO.setTotalCount(list.getTotalElements());
        model.addAttribute("pageVO",pageVO);
        return "report/list";
    }
}
